-
-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix E721 warnings for .pyx files #36036
Conversation
pycodestyle reports: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`. So replace `type(x) == str` with `isinstance(x, str)`, replace `type(x) != type(y)` with `type(x) is not type(y)`, etc.
Thank you for the suggestions; I've implemented them. |
I'm not sure how much of an effect "Resolve conversation" has, but it's fun to click buttons... |
It just collapses the comments for all readers. Good idea to do when a comment has been taken care of and you're not adding a response. |
Thanks! I will rebase on the next beta when it's released. |
This merges cleanly with 10.1.beta9 as is. |
Doesn't build, but somehow has positive review |
Indeed
|
Documentation preview for this PR (built with commit d57321a; changes) is ready! 🎉 |
Fix E721 warnings for .pyx files
pycodestyle reports: "E721 do not compare types, for exact checks use
is
/is not
, for instance checks useisinstance()
." So replacetype(x) == str
withisinstance(x, str)
, replacetype(x) != type(y)
withtype(x) is not type(y)
, etc. This is a followup to #36032 which dealt with .py files.📝 Checklist
⌛ Dependencies